package com.exercise.dao.impl;

import javax.annotation.Resource;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.exercise.dao.ExamDao;
import com.exercise.model.Exam;


@Repository("examDao")
public class ExamDaoImpl implements ExamDao{

	@Resource
	private SessionFactory sessionFactory;
	@Override
	public int saveExam(Exam exam) {
		
		Session session=sessionFactory.getCurrentSession();
		Integer result=(Integer)session.save(exam);
		if (result>0) {
			return result;
		}else{
			return 0;
		}
	}

	@Override
	public int deleteExam() {
		// TODO Auto-generated method stub
		return 0;
	}

	
	
	
}
